<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="./../../resources/templates/baseTemplate.xhtml">

    <ui:define name="content">
        <h:form id="frmTeste">
            <p:selectOneRadio id="options" 
                              value="#{testeBean.exibirCalendario}">
                <p:ajax event="change"
                        listener="#{testeBean.alterarExibicao}"/>
                <f:selectItem itemLabel="Exibir como calendário" itemValue="1" />
                <f:selectItem itemLabel="Exibir como lista" itemValue="2" />
            </p:selectOneRadio>

            <p:outputPanel id="opCalendario" autoUpdate="true">
                <h:outputLabel value="Calendário"
                               rendered="#{testeBean.exibirCalendario == 1}" />
            </p:outputPanel>
            <p:outputPanel id="opLista" autoUpdate="true">
                <h:outputLabel value="Lista" 
                               rendered="#{testeBean.exibirCalendario == 2}"/>
            </p:outputPanel>
        </h:form>
    </ui:define>

</ui:composition>
